<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <%@ include file="/WEB-INF/views/include/head.jsp"%> 
        <script src="${ctxStatic}/js/style.js"></script>
        <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
        <link rel="stylesheet" href="${ctxStatic}/css/list.css">
        
        <script type="text/javascript">
			$(document).ready(function(){
				 	
	            // 下拉选框带搜索功能
	            $("#warehouseID").select2();
				searchListForm();
				
			});	
	               
	    	function searchListForm() {
	    		var params = $("#searchForm").serialize();
	    		$("#activity_pane").showLoading();
	    		$.post("${ctx}/stock/check/searchList",params, function(result) {
	    			var listHtml = result["stockCheck"];
	    			var pageHtml = result["page"];
	    			$("#listHtml").html(listHtml);
	    			$("#paging").html(pageHtml);
	    			$("#activity_pane").hideLoading();
	    		}, 'json');
	    	}
	    	
	        
	        //重置
	        function clean(){
                $('#warehouseID').val('');
                $("#warehouseID").select2(); 
	            searchListForm();
	        }
	        
	        $(document).keydown(function(event){
	        	if(event.keyCode == 13){
	        		searchListForm();
	        	}
	        });
        </script> 
    </head>
    <body>
    <form id="searchForm">
 <div class="listArea" id="activity_pane">
	<div class="listBg">
        <div class="searchArea clearfix">
            <div class="searchLeft clearfix" style="width: 1200px;">
                	<div id="ognizationHtml" class="searchInp clearfix">
                        <!-- 仓库 -->
                        <p><spring:message code="stockCheck_list_warehouse"/></p>
                        <select style="width:130px" id="warehouseID" name="warehouseID">
	                 <option value=""><spring:message code="material_pleaseChoosed"/></option>
	                 <c:forEach items="${warehouselist}" var="warehouse">
                    	<option value="${warehouse.warehouseID }">${warehouse.warehouseName }</option>
	                 </c:forEach>
	              	</select>
                  </div>
                </div>
                <div class="searchRight clearfix">
                    <shiro:hasPermission name="stock:check:view">
		            <%-- <!-- 物料导入 -->
		            <button type="button" class="btn-js"  onclick="popup('500px','150px','${ctx}/material/stock/uploadExcelFile');"><spring:message code="material_materialImport"/></button> --%>
                    <button type="button" id="searchBtn" onclick="searchListForm();"><spring:message code="commom_check"/></button>
                    <button type="button"  onclick="clean();"><spring:message code="common_reset"/></button>
                    <button type="button" onclick="popup('300px','270px','${ctx}/stock/check/create')"><spring:message code="common_create"/></button>
                    </shiro:hasPermission>
                </div>
            </div>
    
       <div class="tableArea">
				<div class="tableScrollSm" style="overflow: auto;width: 754px;height: 714px; ">
                    <table cellpadding="0" class="tableHead">
                        <thead>
                            <tr>
	                            <!-- 序号No. -->
	                            <th><p class="width-50px"><spring:message code="common_no"/></p></th>
	                            <!-- 盘点日期 -->
	                            <th><p class="width-120px"><spring:message code="stockCheck_list_checkDate"/></p></th>
	                            <!-- 仓库 -->
	                            <th><p class="width-200px"><spring:message code="stockCheck_list_warehouseName"/></p></th>
	                            <!-- 状态 -->
	                            <th><p class="width-120px"><spring:message code="stockCheck_list_checkStatus"/></p></th>
	                            <!-- 详情-->
	                            <th><p class="width-120px"><spring:message code="stockCheck_list_checkDetail"/></p></th>
	                            <!-- 创建日期 -->
	                            <th><p class="width-120px"><spring:message code="stockCheck_list_createDate"/></p></th>
                            </tr>
                        </thead>
                    </table>
                    <table cellpadding="0" class="tableBody">
					    <tbody  id = "listHtml"></tbody>	
                	</table>
            	</div>
        	</div>
		</div>
        <div id = "paging" ></div>
      </div>
      </form>
    </body>
</html>